import gtk
import common.gtkobjects.images as common_images

class AbstractGtkIcon:
    
    def __init__(self, image_name=gtk.STOCK_FILE, icon_label='new file'):
        self.image_name = image_name
        self.icon_label = icon_label
        
        self.icon = gtk.VBox()
        self.icon_image = common_images.get_gtk_image_new_from_icon_name(name=self.image_name)
        self.label = gtk.Label(self.icon_label)
        
        self.icon_image.show()
        self.label.show()
        
        self.icon.add(self.icon_image)
        self.icon.add(self.label)
        
    def set_label(self, new_label):
        self.icon_label = new_label
        self.label.set_text(self.icon_label)
        
    def set_image(self, new_image):
        pass
    
    def get_widget(self):
        return self.icon

class GtkFolder(AbstractGtkIcon):
    def __init__(self, folder_name=None):
        if folder_name is None:
            folder_name = 'New Folder'
        AbstractGtkIcon.__init__(self, 'folder', folder_name)
    
class GtkIcon(AbstractGtkIcon):
    def __init__(self, image_name, icon_label):
        AbstractGtkIcon.__init__(self, image_name, icon_label)

        